package com.ruoyi.bcsettings.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bcsettings.mapper.ErpStoreMapper;
import com.ruoyi.bcsettings.domain.ErpStore;
import com.ruoyi.bcsettings.service.IErpStoreService;

/**
 * 门店Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-14
 */
@Service
public class ErpStoreServiceImpl implements IErpStoreService 
{
    @Autowired
    private ErpStoreMapper erpStoreMapper;

    /**
     * 查询门店
     * 
     * @param id 门店主键
     * @return 门店
     */
    @Override
    public ErpStore selectErpStoreById(Integer id)
    {
        return erpStoreMapper.selectErpStoreById(id);
    }

    /**
     * 查询门店列表
     * 
     * @param erpStore 门店
     * @return 门店
     */
    @Override
    public List<ErpStore> selectErpStoreList(ErpStore erpStore)
    {
        return erpStoreMapper.selectErpStoreList(erpStore);
    }

    /**
     * 新增门店
     * 
     * @param erpStore 门店
     * @return 结果
     */
    @Override
    public int insertErpStore(ErpStore erpStore)
    {
        erpStore.setCreateTime(DateUtils.getNowDate());
        return erpStoreMapper.insertErpStore(erpStore);
    }

    /**
     * 修改门店
     * 
     * @param erpStore 门店
     * @return 结果
     */
    @Override
    public int updateErpStore(ErpStore erpStore)
    {
        return erpStoreMapper.updateErpStore(erpStore);
    }

    /**
     * 批量删除门店
     * 
     * @param ids 需要删除的门店主键
     * @return 结果
     */
    @Override
    public int deleteErpStoreByIds(Integer[] ids)
    {
        return erpStoreMapper.deleteErpStoreByIds(ids);
    }

    /**
     * 删除门店信息
     * 
     * @param id 门店主键
     * @return 结果
     */
    @Override
    public int deleteErpStoreById(Integer id)
    {
        return erpStoreMapper.deleteErpStoreById(id);
    }
}
